home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / tool_inc.zip / SYSDATE.INC < prev    next >
Text File  |  1989-06-02  |  1KB  |  43 lines

  1.  
  2. (*
  3.  * Copyright 1987, 1989 Samuel H. Smith;  All rights reserved
  4.  *
  5.  * This is a component of the ProDoor System.
  6.  * Do not distribute modified versions without my permission.
  7.  * Do not remove or alter this notice or any other copyright notice.
  8.  * If you use this in your own program you must distribute source code.
  9.  * Do not use any of this in a commercial product.
  10.  *
  11.  *)
  12.  
  13. (*
  14.  * sysdate - library to return system date and time (3-1-89)
  15.  *
  16.  *)
  17.  
  18. function strval (i: integer): string2;
  19. begin
  20.    strval := chr(((i div 10) mod 10) + ord('0')) +
  21.              chr((i mod 10) + ord('0'));
  22. end;
  23.  
  24. function system_date: string8;   {format: yy/mm/dd}
  25. begin
  26.    reg.ax := $2a00;
  27.    msdos(reg);
  28.    system_date := strval(reg.cx-1900) + '/' +
  29.                   strval(hi(reg.dx))  + '/' +
  30.                   strval(lo(reg.dx));
  31. end;
  32.  
  33. function system_time: string8;   {format: hh:mm:ss}
  34. var
  35.    reg:           registers;
  36. begin
  37.    reg.ax := $2c00;
  38.    msdos(reg);
  39.    system_time := strval(hi(reg.cx)) + ':' +
  40.                   strval(lo(reg.cx)) + ':' +
  41.                   strval(hi(reg.dx));
  42. end;
  43.